home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / varia / egebook.lha / ege.book / 5 / Student.C < prev    next >
C/C++ Source or Header  |  1992-06-05  |  788b  |  33 lines

  1. #include "Student.h"
  2. #include "Collection.h"
  3. #include "Schedule.h"
  4.  
  5. Collection* Student::Body = new Collection;
  6.  
  7. void Student::maintain() {
  8.   String selection;
  9.   while (TRUE) {
  10.     cout << "register (r) for course or maintain (m) ? ";
  11.     cin >> selection;
  12.     if (selection.contains("r"))
  13.       signup();
  14.     else if (selection.contains("m")) {
  15.       cout << "student is registered for these courses:\n";
  16.       taking->maintain();
  17.     } else
  18.       break;
  19.   };
  20. }
  21.  
  22. void Student::signup() {
  23.   Example *sel_schedule, *sel_course;
  24.   cout << "select a semester:\n";
  25.   if ((sel_schedule = Schedule::All->select()) != NULL) {
  26.     cout << "select which course:\n";
  27.     if ((sel_course = sel_schedule->select()) != NULL) {
  28.       taking->add(sel_course);
  29.       sel_course->add(this);
  30.     };
  31.   };
  32. }
  33.